package com.bzchao.niu.runner;

import com.bzchao.netty.udp.server.UdpEventServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@Component
public class UdpEventRunner implements ApplicationRunner {

    @Autowired
    private UdpEventServer udpEventServer;

    @Value("${server.udp.port:8800}")
    private int port;

    @Override
    public void run(ApplicationArguments args) {
        udpEventServer.syncStart(port);
    }

}
